<?php
/**
 * 角色
 * @author Administrator
 *
 */
class AdminRoleModel extends Model {
	
	protected $tableName = "admin_role"; // 表名
	
	/**
	 * 获取菜单深度
	 *
	 * @param int $id        	
	 * @param array $array        	
	 * @param int $i        	
	 */
	public function get_level($id, $array = array(), $i = 0) {
		foreach ( $array as $n => $value ) {
			if ($value ['id'] == $id) {
				if ($value ['parentid'] == '0')
					return $i;
				$i ++;
				return $this->get_level ( $value ['parentid'], $array, $i );
			}
		}
	}
}
?>